//
//  NewestTopicTableViewCell.m
//  SoundPill
//
//  Created by 宋旭东 on 15/11/27.
//  Copyright © 2015年 宋旭东. All rights reserved.
//

#import "NewestTopicTableViewCell.h"
#import "NewestLabels.h"
@interface NewestTopicTableViewCell ()
{
    
    
}
@property (strong, nonatomic) NewestLabels *topicLabels;
@property (strong, nonatomic) UIView *topLine;
@property (strong, nonatomic) UIView *bottomLine;
@end

@implementation NewestTopicTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier topicArray:(NSArray *)topicArray
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.topicArray = [NSArray arrayWithArray:topicArray];
        [self initSubviews];
        self.userInteractionEnabled = YES;
        //self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        self.backgroundColor=[UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}
- (void)initSubviews
{
    self.topicLabels  = [[NewestLabels alloc] initWithFrame:self.bounds TopicCount:_topicArray.count];
    _topicLabels.layer.borderColor = [[UIColor blackColor] CGColor];
    _topicLabels.layer.borderWidth = 2;
    [self addSubview:_topicLabels];
    self.topLine = [[UIView alloc] initWithFrame:CGRectZero];
//    _topLine.backgroundColor = [UIColor blackColor];
//    self.bottomLine = [[UIView alloc] initWithFrame:CGRectZero];
//    _bottomLine.backgroundColor = [UIColor blackColor];
//    [self addSubview:_topLine];
//    [self addSubview:_bottomLine];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    _topicLabels.frame = CGRectMake(15, 10, self.frame.size.width - 30, self.frame.size.height - 20);
    [_topicLabels layoutTopicLabel:_topicArray];
    _topLine.frame = CGRectMake(0, 0, self.frame.size.width, 1);
    _bottomLine.frame = CGRectMake(0, self.frame.size.height, self.frame.size.width, 1);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
